﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WHC.Hotel.Entity;
using WHC.Hotel.BLL;
using WHC.OrderWater.Commons;

namespace WHC.Hotel.UI
{
    public partial class FrmRoomDetail : Form
    {
       
        public FrmRoomDetail()
        {
            InitializeComponent();
        }


        public void ShowSelectedRoomInfo(RoomInfo mRoomInfo)
        {

            lblRoomNo.Text = mRoomInfo.RoomNo;
            lblRoomType.Text = mRoomInfo.RoomType;
            lbRoomBuildNum.Text = mRoomInfo.BuildNum;
            lbRoomFloor.Text = mRoomInfo.Floor;
            if (mRoomInfo.OrderInfo != null)
            {

                lblDiscountPrice.Text = mRoomInfo.OrderInfo.DiscountPrice.ToString("C2");
                lblOriginalPrice.Text = mRoomInfo.OrderInfo.OriginalPrice.ToString("C2");
                CustomerInfo customerInfo = BLLFactory<Customer>.Instance.FindByID(mRoomInfo.OrderInfo.Customer_ID);
                if (customerInfo != null)
                {
                    lbCustomerType.Text = customerInfo.CustomerType;
                    lbCustomer.Text = mRoomInfo.OrderInfo.CustomerName + "(" + customerInfo.Sex + ")";
                }
                else
                {
                    lbCustomer.Text = mRoomInfo.OrderInfo.CustomerName ;
                }
                lblDeposit.Text = mRoomInfo.OrderInfo.DepositMoney.ToString("C2");
                lbArriveTime.Text = mRoomInfo.OrderInfo.CreateDate.ToString();
                lbPreLeaveTime.Text = mRoomInfo.OrderInfo.PreOffDate.ToString();
                lblPayType.Text = mRoomInfo.OrderInfo.PayType;

            }
            else
            {

                lblDiscountPrice.Text ="";
                lblOriginalPrice.Text = "";
                lbCustomer.Text ="";
                lbCustomerType.Text = "";
                lblDeposit.Text ="";
                lbArriveTime.Text ="";
                lbPreLeaveTime.Text = "";
                lblPayType.Text = "";
            
            
            }
        
        
        
        
        }
    }
}
